# 异常的传递
# def func1():
#     num=int(input("请输入一个数字："))
#     return num
# def func2():
#     return func1()
# def func3():
#     return func2()
# if __name__=="__main__":
#     try:
#         result=func3()
#         print(result)
#     except Exception as e:
#         print("发生了异常：",e)
#     finally:
#         print("程序结束")

# 抛出异常
# def func1():
#     passwrod = input("请输入密码：")
#     if len(passwrod) >= 8:
#         print("密码格式正确")
#         return passwrod
#     else:
#         raise ValueError("密码长度必须大于等于6位")
#
#
# passwrod = func1()
# print("密码：", passwrod)
